home *** CD-ROM | disk | FTP | other *** search
- //=--------------------------------------------------------------------------=
- // CInternetControl.H
- //=--------------------------------------------------------------------------=
- // Copyright 1995 Microsoft Corporation. All Rights Reserved.
- //
- // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
- // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
- // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
- // PARTICULAR PURPOSE.
- //=--------------------------------------------------------------------------=
- //
- // class declaration for the URLDib2 control.
- //
- #ifndef __INTERNETCONTROL_H_
- #define __INTERNETCONTROL_H_
-
- #define DISPID_PROGRESS 1958
-
- #ifndef __MKTYPLIB__
-
- #include "Sweeper.H"
-
- #include "IPServer.H"
- #include "CtrlObj.H"
-
-
-
- class CInternetControl : public COleControl,
- public IServiceProvider
- {
- public:
- CInternetControl(IUnknown *pUnkOuter, int iPrimaryDispatch, void *pMainInterface);
- virtual ~CInternetControl();
-
- // IUnknown methods
- //
- DECLARE_STANDARD_UNKNOWN();
-
- // Call this method to start the download of a URL. 'propId' will
- // be passed back to you OnData below.
- HRESULT SetupDownload( LPOLESTR url, DISPID propId);
-
-
- // Call this method to start the download of a moniker. 'propId' will
- // be passed back to you OnData below.
- HRESULT SetupDownload( IMoniker * moniker, DISPID propId);
-
-
- // Call this method to start the download of a moniker that is
- // embedded in a stream (like a property). 'propId' will
- // be passed back to you OnData below.
- HRESULT SetupDownload( IStream * propStream, DISPID propId);
-
-
- // Derived classes implement this method. It will be called when
- // data has arrived for a given dispid.
- virtual HRESULT OnData( DISPID id, DWORD grfBSCF,IStream * bitstrm, DWORD amount );
-
-
- // Derived classes can implement this method. It will be
- // called at various times during the download.
- virtual HRESULT OnProgress( DISPID id, ULONG ulProgress, ULONG ulProgressMax,
- ULONG ulStatusCode, LPCWSTR pwzStatusText);
-
-
-
-
- // Call this method to turn a URL into a Moniker.
- HRESULT GetAMoniker( LPOLESTR url, IMoniker ** );
-
-
- // This method is a utility in case someone wants to know the
- HRESULT GetBindHost(IBindHost ** pHost );
-
-
- // Convert a propId to an IBinding. (This only works if the
- // download is actually in progress.
- HRESULT GetBinding(DISPID,IBinding**);
-
-
- HRESULT FireReadyStateChange( long newState );
- HRESULT FireProgress( ULONG dwAmount );
-
- // Just to be good citizen. The impelmentation delegates
- // to the client site.
-
- STDMETHOD(QueryService)(REFGUID guidService,
- REFIID riid, void **ppvObject);
-
- virtual HRESULT InternalQueryInterface(REFIID, void **);
-
- protected:
- HRESULT GetBindHost();
-
- IBindHost * m_host;
- class CDownloadSink * m_downloads;
- long m_readyState;
-
- };
-
- #endif __MKTYPLIB__
-
- #endif __INTERNETCONTROL_H_
-
-